
public class caoZuo {
	private int number;
	private double balance;//定义一个余额
	public int getNumber() {
		return number;
	}
	public void setNumber(int number) {
		this.number = number;
	}
	public double getBalance() {
		return balance;
	}
	public void setBalance(double balance) {
		this.balance = balance;
	}
	public caoZuo(int number){
		this.number=number;
		
	}
	public void cunqian(double amount){//定义存钱过程
		balance=balance+amount;
	}
	public  void  quqian  (double amount)throws  Exception {//定义取钱过程
		if(amount<=balance){
			balance=balance-amount;
		}else{
			double need=amount-balance;
			
			throw new Exception();
			
		}
		
		
	}
	public double getBalance1(){
		return balance;
	}

	
	
	
	

}
